import javafx.scene.shape.Circle;

public class Homework {

    public static void main(String[] args) {

        double []arr = {4.4,2.1,5.1,7.3,2.5,9.9,6.5};
        Homework hw = new Homework();
        System.out.println(hw.max(arr));

//        System.out.println("111111111");

        System.out.println( hw.find("dsjkhahncf",'c'));

        System.out.println(hw.updataPrice(200));


        int []intarr = { 1,2,3,1,5,6,7,8,9 };
        int []mo = hw.copyArr(intarr);
        System.out.println(mo.equals(intarr));//false

        System.out.println(hw.Circle(5));
    }

    public  double max(double[] arr){
        double temp =  arr[0];
        for (int i = 1; i < arr.length-1; i++) {
            if(arr[i]<arr[i+1]){
                temp = arr[i+1];
            }else{
                temp = arr[i];
            }
        }
        return temp;
    }

    public  int  find(String str,char c){
//        for (int i = 0; i < str.length(); i++) {
//            if(str.charAt(i) == c){
//                return i;
//            }else{
//                return  -1;
//            }
//        }
        for (int i = 0; i < str.length(); i++) {
            if(str.charAt(i) == c){
                return i;
            }
        }
        return  -1;
    }


    public  int  updataPrice(int price){
//        int price = 100;
        if(price>100 && price <150){
            price = 100;
        }else if(price >150){
            price = 150;
        }
        return price;
    }

    public int[] copyArr(int[ ] arr){
//        int[] arr = {1,2,3,4,5,6,7,8,9,10};
        int[] newArr = new int[arr.length];
        for (int i = 0; i < arr[i]; i++) {
            newArr[i] = arr[i];
        }
        return newArr;
    }


    public double  Circle(int r){
        return 3.14*r*r;
    }

//    public  double Cale(double n1,double n2){
//        return  n1
//    }
}

